﻿using StoreAppLib;
using StoreAppLibDemo.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StoreAppLibDemo.ViewModel
{
    public class PieChartPageView: BindableBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PieChartPageView"/> class"
        /// </summary>
        public PieChartPageView()
        {
            List<MonthValue> series = new List<MonthValue>();

            series.Add(new MonthValue() { Month = "Jan", Value = 25 });
            series.Add(new MonthValue() { Month = "Feb", Value = 10 });
            series.Add(new MonthValue() { Month = "Mar", Value = 22 });
            series.Add(new MonthValue() { Month = "Apr", Value = 16 });
            series.Add(new MonthValue() { Month = "May", Value = 12 });
            series.Add(new MonthValue() { Month = "Jun", Value = 21 });
            series.Add(new MonthValue() { Month = "Jul", Value = 39 });
            series.Add(new MonthValue() { Month = "Aug", Value = 14 });
            series.Add(new MonthValue() { Month = "Sep", Value = 33 });
            series.Add(new MonthValue() { Month = "Oct", Value = 5 });
            series.Add(new MonthValue() { Month = "Nov", Value = 19 });
            series.Add(new MonthValue() { Month = "Dec", Value = 8 });

            this.Data = new ObservableCollection<MonthValue>(series);
        }

        /// <summary>
        /// Variable to hold the chart data.
        /// </summary>
        private ObservableCollection<MonthValue> data;

        /// <summary>
        /// Gets or sets the chart data.
        /// </summary>
        /// <value>
        /// The chart data.
        /// </value>
        public ObservableCollection<MonthValue> Data
        {
            get
            {
                return this.data;
            }

            set
            {
                this.SetProperty(ref this.data, value);
            }
        }
    }
}
